<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>Infor列表</title>
    <link rel="stylesheet" href="${ctx}/static/styles/news/newslist.css" type="text/css">
</head>

<body>
<div class="news-main">
    <div class="container">
        <h2>Infor列表</h2>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>#</th>
                <th>title</th>
                <th>author</th>
                <th>发布日期</th>
                <th>管理</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${inforPage.content}" var="infor" varStatus="status">
                <tr data-infor-id="${infor.id}">
                    <td>${status.index + 1}</td>
                    <td><a href="${ctx}/infor/detail/${infor.id}" target="_blank">${infor.title}</a></td>
                    <td><c:if test="${infor.author != null}">${infor.author.name}</c:if></td>
                    <td><fmt:formatDate value="${infor.publishDate}" type="date" dateStyle="long"/></td>
                    <td><a href="${ctx}/admin/comment/list/${infor.id}" class="btn btn-primary">评论管理</a><a
                            href="${ctx}/admin/infor/delete/${infor.id}" class="btn btn-danger">删除</a></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <tags:pagination page="${inforPage}" paginationSize="10"/>
    </div>
</div>
</body>
</html>